const schema = {
  type: "object",
  properties: {
    44444: {
      title: "点击多选",
      type: "array",
      props: {
        options: [
          {
            label: "A",
            value: "A",
          },
          {
            label: "B",
            value: "B",
          },
          {
            label: "C",
            value: "C",
          },
        ],
        direction: "row",
      },
      widget: "checkboxes",
    },
    "fr-5u8e": {
      title: "多行文本",
      type: "string",
      widget: "textArea",
    },
    "fr-1cna": {
      title: "树选择",
      props: {
        treeData: [
          {
            value: "parent 1",
            title: "parent 1",
            children: [
              {
                value: "parent 1-0",
                title: "parent 1-0",
                children: [
                  {
                    value: "leaf1",
                    title: "leaf1",
                  },
                  {
                    value: "leaf2",
                    title: "leaf2",
                  },
                ],
              },
            ],
          },
        ],
        placeholder: "请选择",
      },
      widget: "treeSelect",
    },
    table: {
      title: "列表table",
      description: "2333",
      type: "array",
      items: {
        title: "阿达",
        description: "12313",
        column: 2,
        type: "object",
        widget: "collapse",
        properties: {
          "fr-dgou": {
            title: "Html",
            widget: "html",
          },
        },
      },
      widget: "cardList",
      labelCol: {
        span: 8,
      },
      wrapperCol: {
        span: 10,
      },
    },
  },
  displayType: "row",
  maxWidth: "340px",
};

export default [
  {
    url: "/api/getSchema",
    type: "get",
    response() {
      return {
        code: 200,
        msg: "success",
        data: { schema },
      };
    },
  },
  {
    url: "/api/setSchema",
    method: "post",
    response: (data) => {
      if (data) {
        return {
          code: 200,
          msg: "success",
          data: {
            data,
          },
        };
      }
      return {
        code: 500,
        msg: "解析失败。",
        data: {
          data,
        },
      };
    },
  },
];
